const fs = require('fs');
const path = require('path');

// 创建目录
const iconDir = path.join(__dirname, '../images/tabbar');
if (!fs.existsSync(iconDir)) {
  fs.mkdirSync(iconDir, { recursive: true });
}

// 创建一个 81x81 的透明 PNG 文件
const pngData = Buffer.from([
  0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D,
  0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x51,
  0x08, 0x06, 0x00, 0x00, 0x00, 0x8E, 0x38, 0x6B, 0x98, 0x00, 0x00, 0x00,
  0x0A, 0x49, 0x44, 0x41, 0x54, 0x08, 0xD7, 0x63, 0x60, 0x00, 0x00, 0x00,
  0x02, 0x00, 0x01, 0xE2, 0x21, 0xBC, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49,
  0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82
]);

// 创建图标文件
const icons = [
  'home.png',
  'home-active.png',
  'wrong.png',
  'wrong-active.png',
  'knowledge.png',
  'knowledge-active.png',
  'profile.png',
  'profile-active.png'
];

icons.forEach(icon => {
  const filePath = path.join(iconDir, icon);
  fs.writeFileSync(filePath, pngData);
  console.log(`Created ${filePath}`);
}); 